package com.qfhd.soft.cjzcore.Model;

import com.qfhd.soft.cjzcore.Core.CJJsonUtils;

import org.json.JSONObject;

public class CardDetailInfo {
    /**
     * 单位：分  例如：100 = 1元
     */
//    @SerializedName("cash_limit")
    public int cashNumber;
    public String coupon_sn;
    /**
     * 状态：1.未使用 2.使用过
     */
    public int status;
    public String expiration_time;//截止日期

//    public CashCard(int cashNumber,int status,String expiration_time ,String coupon_sn){
//        this.cashNumber = cashNumber;
//        this.status     = status;
//        this.expiration_time    = expiration_time;
//        this.coupon_sn  = coupon_sn;
//    }

    public static CardDetailInfo getModelByJSONObject(JSONObject obj){
        CardDetailInfo cashCard = new CardDetailInfo();
        cashCard.cashNumber = CJJsonUtils.getValueFromKey_int(obj,"cash_limit");
        cashCard.coupon_sn = CJJsonUtils.getValueFromKey_string(obj,"coupon_sn");
        cashCard.status = CJJsonUtils.getValueFromKey_int(obj,"status");
        cashCard.expiration_time = CJJsonUtils.getValueFromKey_string(obj,"expiration_time");
        return cashCard;
    }
}
